<UserControl 
    x:Class="ibba.src.noriskbo.XamGridToolBar"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:slc="clr-namespace:ibba.src.sl.componentes;assembly=ibba.src.sl.componentes"
    mc:Ignorable="d">

    <UserControl.Resources>
        <slc:SwitchConverter x:Key="CheckIconConverter" 
                             Else="{StaticResource IconeMiniUnchecked}">
            <slc:SwitchCase When="True" Then="{StaticResource IconeMiniChecked}" />
        </slc:SwitchConverter>
    </UserControl.Resources>
    
    <Grid x:Name="LayoutRoot" Background="White">
        <Border Background="#FFEFEFEF" BorderThickness="1,0,1,1" BorderBrush="#FF617583" Height="31" 
                VerticalAlignment="Stretch" HorizontalAlignment="Stretch">

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <StackPanel x:Name="panelQtdRegistro" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0" Visibility="Collapsed" Margin="5,0,0,0">
                    <TextBlock Text="Quantidade de registros:  " Height="16" />
                    <TextBlock Name="lblQuantidadeDeRegistros" Height="16" />
                </StackPanel>

                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="1">
                    <StackPanel x:Name="PagingPanel" Orientation="Horizontal" Visibility="Collapsed" Margin="5,0,0,0">
                        <TextBlock Text="Exibir" VerticalAlignment="Center" FontSize="11" />
                        <ComboBox x:Name="PageSize" Height="22" Width="65" Cursor="Hand" Margin="5,3,0,3" FontSize="10"
                              SelectionChanged="PageSize_SelectionChanged">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <Grid Width="65">
                                        <TextBlock Text="{Binding Text}" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                    </Grid>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal" Height="22" Width="22" Margin="5,0,0,0" ToolTipService.ToolTip="Copiar nome da coluna">
                        <Border BorderThickness="1,1,1,1" BorderBrush="#FFA5A6AD" CornerRadius="3" Height="22" Width="22" />
                        <Image Source="{StaticResource IconeCopiarColar}" Width="18" Height="18" Margin="-24,-2,0,0" MouseLeftButtonUp="chkCopyPaste_MouseLeftButtonUp" />
                        <Image Name="chkCopyPaste" Source="{StaticResource IconeMiniUnchecked}" 
                                Height="16" Width="16" Cursor="Hand" Margin="-13,8,0,0" MouseLeftButtonUp="chkCopyPaste_MouseLeftButtonUp" />
                    </StackPanel>

                    <StackPanel Orientation="Horizontal" Height="22" Width="22" Margin="5,0,0,0" ToolTipService.ToolTip="Expandir apenas uma linha por vez">
                        <Border BorderThickness="1,1,1,1" BorderBrush="#FFA5A6AD" CornerRadius="3" Height="22" Width="22" />
                        <Image Source="{StaticResource IconeExpandOnly}" Width="16" Height="16" Margin="-24,-2,0,0" MouseLeftButtonUp="chkExpandOnly_MouseLeftButtonUp" />
                        <Image Name="chkExpandOnly" Source="{StaticResource IconeMiniUnchecked}" 
                                Height="16" Width="16" Cursor="Hand" Margin="-13,8,0,0" MouseLeftButtonUp="chkExpandOnly_MouseLeftButtonUp" />
                    </StackPanel>

                    <Button x:Name="ExibirAgrupamentoButton" Width="22" Height="22" VerticalAlignment="Center" Margin="5,3,0,3" ToolTipService.ToolTip="Painel de agrupamento"
                            Click="ExibirAgrupamentoButton_Click">
                        <Image Source="{StaticResource IconeGroupBy}" />
                    </Button>

                    <Button x:Name="ExibirExportacaoExcelButton" Width="22" Height="22" VerticalAlignment="Center" Margin="5,3,0,3" ToolTipService.ToolTip="Exportar as dados para um arquivo Excel"
                            Click="ExibirExportacaoExcelButton_Click" >
                        <Image Source="{StaticResource IconeExcel}" />
                    </Button>

                    <Button x:Name="PersonalizarModoExibicaoButton" Width="22" Height="22" VerticalAlignment="Center" Margin="5,3,0,3" ToolTipService.ToolTip="Seletor de campos"
                            Click="PersonalizarModoExibicaoButton_Click">
                        <Image Source="{StaticResource IconeTools}" />
                    </Button>

                    <Button x:Name="ReiniciarConfiguracaoButton" Width="22" Height="22" VerticalAlignment="Center" Margin="5,3,5,3" ToolTipService.ToolTip="Restaurar campos iniciais"
                            Click="ReiniciarConfiguracaoButton_Click">
                        <Image Source="{StaticResource IconeRefresh}" />
                    </Button>

                </StackPanel>
            </Grid>

        </Border>
    </Grid>
</UserControl>
